/*
 * ConsumptionRate.java
 * Team qq 2011
 */
package com.google.code.timetrail.backend;

public enum ConsumptionRate {
	NONE("None"), BAREBONES("Barebones"), MEAGER("Meager"), NORMAL("Normal"), WELLFED(
			"Well-Fed");

	/**
	 * The value for the none enum
	 */
	private static final int NONE_VALUE = 0;

	/**
	 * The value for the barebones enum
	 */
	private static final int BAREBONES_VALUE = 1;

	/**
	 * The value for the meager enum
	 */
	private static final int MEAGER_VALUE = 2;

	/**
	 * The value for the normal enum
	 */
	private static final int NORMAL_VALUE = 3;

	/**
	 * The value for the well-fed enum
	 */
	private static final int WELLFED_VALUE = 4;

	/** The amount of food per person that is consumed per turn */
	private final int perPersonCon;

	/** The name of the ration consumption rate */
	private final String name;

	/**
	 * This initializes the ConsumptionRate enum
	 * 
	 * @param name
	 *            Passes the name of the enum
	 */
	private ConsumptionRate(String name) {
		this.name = name;

		if (this.name.equals("None")) {
			this.perPersonCon = NONE_VALUE;
		} else if (this.name.equals("Barebones")) {
			this.perPersonCon = BAREBONES_VALUE;
		} else if (this.name.equals("Meager")) {
			this.perPersonCon = MEAGER_VALUE;
		} else if (this.name.equals("Normal")) {
			this.perPersonCon = NORMAL_VALUE;
		} else if (this.name.equals("Well-Fed")) {
			this.perPersonCon = WELLFED_VALUE;
		} else {
			this.perPersonCon = 0;
		}
	}

	/**
	 * This method will return the get per person count
	 * 
	 * @return The get per person count
	 */
	public int getPerPersonCon() {
		return perPersonCon;
	}

	/**
	 * This method will return the name of the consumption rate
	 * 
	 * @return The name
	 */
	public String getName() {
		return name;
	}
}
